/**
 * 配置参考: https://cli.vuejs.org/zh/config/
 */
module.exports = {
  baseUrl: process.env.NODE_ENV === 'production' ? './' : '/',
  productionSourceMap: false,
  outputDir: 'single',
  configureWebpack: {
    externals: {
      'BMap': 'BMap'
    }
  },
  devServer: {
    open: true,
    port: 8017,
    proxy: {
      '/api': {
        target: 'http://apitest.oucnet.com',
        secure: false,
        ws: true,
        changeOrigin: true,
        pathRewrite: { '^/api': '' }
      },
      '/platform': {
        target: 'http://172.16.146.10:7004',
        secure: false,
        ws: true,
        changeOrigin: true,
        pathRewrite: { '^/platform': '/platform' }
      }
    },
    overlay: {
      errors: true,
      warnings: true
    }
  },
  css: {
    loaderOptions: {
      postcss: {
        plugins: [
          require('postcss-pxtorem')({
            rootValue: 100, // 换算的基数
            propList: ['*'],
            selectorBlackList: ['.van-']
          })
        ]
      }
    }
  }
}
